package com.chagee.channel.server.event.service.strategy.larkCallback;

import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author cjw
 * @date 2024/1/23 18:57
 * @description
 */
@Component
@RequiredArgsConstructor
public class CallbackHandlerFactory {

    private final List<CallbackHandler> callbackHandlerList;

    public CallbackHandler getCallbackHandler(String type) {
        for (CallbackHandler callbackHandler : callbackHandlerList) {
            if (callbackHandler.getType(type)) {
                return callbackHandler;
            }
        }
        return null;
    }

}
